#!/usr/bin/ruby

file = File.new("/local/joofeit/VerbsPlusDfSorted","r")
file200 = File.new("/local/joofeit/Verbs_1-200","w")
file1000 = File.new("/local/joofeit/Verbs_200-1000","w")
file5000 = File.new("/local/joofeit/Verbs_1000-5000","w")
file20000 = File.new("/local/joofeit/Verbs_5000-20000","w")
file100000 = File.new("/local/joofeit/Verbs_20000-100000","w")
fileMorethan100000 = File.new("/local/joofeit/Verbs_MoreThan100000","w")

counter1 =0
c2 =0
c3=0
c4=0
c5 =0
c6 =0

while(line = file.gets)
  words = line.split(" ")
  if((Integer (words[0])) <=200 )
    counter1=counter1+1
    file200.write(line)
  end
  if((Integer (words[0])) >200 &&((Integer (words[0]))<=1000))
    file1000.write(line)
    c2 =c2+1
  end
  if((Integer (words[0])) >1000 &&((Integer (words[0]))<=5000))
    file5000.write(line)
    c3=c3+1
  end
  if((Integer (words[0])) >5000 &&((Integer (words[0]))<=20000))
    file20000.write(line)
    c4=c4+1
  end
  if((Integer (words[0])) >20000 &&((Integer (words[0]))<=100000))
    file100000.write(line)
    c5=c5+1
  end
  if((Integer (words[0])) >100000 )
    fileMorethan100000.write(line)
    c6 =c6+1
  end

end
file.close
file200.close
file1000.close
file5000 .close
file20000.close
file100000.close
fileMorethan100000.close
puts "<200: "+counter1.to_s
puts "200-1000: "+c2.to_s
puts "1000-5000: "+c3.to_s
puts "5000-20000: "+c4.to_s
puts "20000-100000: "+c5.to_s
puts ">100000: "+c6.to_s
